package com.avantis.common.repository;

import com.avantis.common.entity.Notification;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;
import com.avantis.common.entity.User;

import java.util.List;

/**
 * @ClassName NotificationRepository
 * @Description TODO
 * @Author kirago
 * @Date 2018/11/26 19:30
 * @Version 1.0
 **/
@Repository
public interface NotificationRepository extends JpaRepository<Notification, Integer> {

//	@Query(value = "SELECT count(id) FROM quark_notification n WHERE n.touser_id = ?1 AND n.is_read = 0", nativeQuery = true)
//	long getNotificationCount(Integer id);

//	List<Notification> getByTouserOrderByInitTimeDesc(User user);

//	@Modifying
//	@Query("update Notification n set n.isRead = true where n.touser = ?1")
//	void updateByIsRead(User user);

}
